<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:gp="http://gp.componentes.jsf"
      xmlns:c="http://java.sun.com/jsp/jstl/core"> 

	<ui:composition>
	
		<div id="aux" class="step-pane"> <!-- class step-pane utilizada apenas para o conteúdo não aparecer na tela antes do componente ser criado -->
		
			<li class="" data-step="#{title}">#{title}</li>
			
		</div>
			
		<div class="step-pane" data-step="#{title}">
			<ui:insert></ui:insert>
		</div>
		
		<div class='script'>
      							
			<script type="text/javascript">
	
				num++;
									
				var titulo = '#{title}';				
				var badgeVisible = #{badgeVisible};
				var badgeClass = ' badge ';
				var badge = '#{badge}';
				var conteudo = '';
				
				<c:if test = "#{active}">
	
					$('#aux li').addClass('active');
					$('.step-pane').addClass('active');
	
					active = num;
	
				</c:if>
	
				<c:if test = "#{not empty stepClass}">

					var stepClass = '#{stepClass}';
					conteudo = '<span class="'+stepClass+'"></span>';
					$('#aux li').append(conteudo);
	
				</c:if>	

				<c:if test = "#{badgeVisible}">

					<c:if test = "#{not empty badgeClass}">
	
						badgeClass = '#{badgeClass}';
	
					</c:if>
	
					conteudo = '<span id="badge" class="' +badgeClass+ '">'+badge+'</span>';
					$('#aux li').prepend(conteudo);
	
				</c:if>	

				conteudo = $("#aux").html();
				$("#aux").remove();
				$('.steps').append(conteudo);
	
				<c:set var="title" value="" />
				<c:set var="badgeVisible" value="" />
				<c:set var="badgeClass" value="" />
				<c:set var="badge" value="" />
				<c:set var="stepClass" value="" />
				<c:set var="active" value="" />
				<c:set var="conteudo" value="" />
								
			</script>
		
		</div>
      	
      </ui:composition>
      
</html>
